<?php


namespace app\admin\validate;


use think\Validate;

class Monitors extends Validate
{
    // 验证规则
    protected $rule = [
        'name'      => 'require|unique:monitor_class',
        'c_id'      => 'require',
        'serial'    => 'require',
        'code'      => 'require',
        'img'       => 'require',
        'sort'      => 'require|number',
    ];
    //错误信息
    protected $message = [
        'name.require'      => '请输入监控名称',
        'name.unique'       => '监控名称已存在',
        'c_id.require'      => '请选择分类名称',
        'serial.require'    => '请输入设备序列号',
        'code.require'      => '请输入设备验证码',
        'img.require'       => '请上传主图',
        'sort.require'      => '请输入排序',
        'sort.number'       => '排序必须为数字',
    ];
}